/* Controller */

#import <Cocoa/Cocoa.h>

@interface Controller : NSObject
{
    IBOutlet NSPopUpButton *channelsBox;
    IBOutlet NSPopUpButton *providersBox;
    IBOutlet NSPopUpButton *regionsBox;
	IBOutlet NSTableView *programTable;
	IBOutlet NSDatePicker * dateBox;
	IBOutlet NSTextField * statusText;
	IBOutlet NSProgressIndicator * progressIndicator;
	IBOutlet NSPanel * aboutPanel;
	
	NSMutableDictionary * m_regionsCache;
	NSMutableDictionary * m_providersCache;

	NSMutableArray * m_regionsArrayCache;
	NSMutableArray * m_providersArrayCache;

	NSMutableDictionary * m_channelsCache;
	
	NSMutableArray * m_tableData;
	
	NSURLConnection * m_urlConnection;
	NSMutableData * m_urlData;
	NSConditionLock * m_urlDataLock;
	// NSXMLDocument
}

-(void)flagURLError:(NSString*)errorString;

-(void)applicationWillTerminate:(NSNotification *)notification;

-(NSArray*)getJustChannelNames:(NSString*)provider region:(NSString*)region;

-(void)providersRegionChanged:(id)sender;

-(void)savePreferences;

-(void)restorePreferences;


@end
